Skip to content

fix(#50): add transaction history tracking#491

Open
senmalong wants to merge 6 commits into
Smartdevs17:mainfrom
senmalong:fix/50-transaction-history
Open

fix(#50): add transaction history tracking#491
senmalong wants to merge 6 commits into
Smartdevs17:mainfrom
senmalong:fix/50-transaction-history

Conversation

@senmalong
Copy link
Copy Markdown
Contributor

Summary

Closes #50

Implements full transaction history tracking — store, types, screen with detail view, and block explorer links.

Files

src/types/transaction.ts (new)

  • Transaction interface: id, subscriptionId, subscriptionName, amount, currency, status, type, date (ISO), txHash, chainId, explorerUrl, failureReason, notes
  • TransactionStatus enum: pending | confirmed | failed | cancelled
  • TransactionType enum: fiat | crypto | refund

src/store/transactionStore.ts (new)

  • Zustand store persisted to AsyncStorage (subtrackr-transaction-history)
  • addTransaction — prepends and caps at 500 records
  • updateTransactionStatus — update status + optional failure reason
  • getBySubscription / getByStatus — filtered selectors
  • clearHistory

src/screens/TransactionHistoryScreen.tsx (new)

  • FlatList of all transactions, newest first
  • Filter chips: All / Confirmed / Pending / Failed
  • Each row: subscription name, date, type, amount, colour-coded status badge; crypto rows show shortened tx hash
  • Tap a row → bottom-sheet detail panel with full fields
  • Block explorer link: Linking.openURL(explorerUrl/tx/txHash)

src/store/index.ts — exports useTransactionStore

src/navigation/types.ts — adds TransactionHistory route

src/navigation/AppNavigator.tsx — registers TransactionHistoryScreen

Acceptance Criteria

  • Transactions stored (Zustand + AsyncStorage, capped at 500)
  • History screen displays transactions with filter chips
  • Details show amount, date, status, tx hash, chain ID, failure reason
  • Links to block explorer work via Linking.openURL

senmalong added 6 commits June 1, 2026 07:41
autoFocus opens the keyboard immediately on mount, which can block
UI elements before the screen finishes rendering. Replace it with a
ref-based focus triggered after a 300 ms delay, giving the navigation
transition time to complete on both iOS and Android.

- Add nameInputRef (useRef<TextInput>) to the name field
- Remove autoFocus prop from the name TextInput
- Focus the input programmatically after 300 ms in a useEffect
- Import useRef from React
…lity tracking

- Switch KeyboardAvoidingView behavior to 'padding' on iOS and
  undefined on Android (Android handles scroll natively)
- Track keyboard show/hide events with Keyboard listeners to set
  isKeyboardVisible state
- Apply extra bottom padding to ScrollView content when keyboard is
  open so all form fields remain reachable
- Import Keyboard from react-native
- Add src/services/crashReporter.ts: persists crash records to
  AsyncStorage, installs a global ErrorUtils handler for uncaught JS
  errors, detects previous crash on next launch, and supports optional
  remote endpoint reporting
- Add src/components/CrashRecoveryModal.tsx: modal shown on launch
  when a previous crash is detected; lets user trigger data recovery
  or continue without recovering
- Update ErrorBoundary to call crashReporter.recordCrash() in
  componentDidCatch so React render errors are also persisted
- Initialize crashReporter early in App startup (alongside i18n)
- On launch, if a previous crash is detected, show CrashRecoveryModal
- handleRecover calls crashReporter.attemptDataRecovery() which clears
  corrupted AsyncStorage state while preserving settings and auth keys
- handleDismissRecovery marks the crash as notified so the modal does
  not reappear on subsequent launches
- Import Alert for recovery-failure feedback
- Add src/types/transaction.ts: Transaction interface with id,
  subscriptionId, subscriptionName, amount, currency, status, type,
  date, txHash, chainId, explorerUrl, failureReason, notes
- Add TransactionStatus (pending/confirmed/failed/cancelled) and
  TransactionType (fiat/crypto/refund) enums
- Add src/store/transactionStore.ts: Zustand persisted store with
  addTransaction, updateTransactionStatus, getBySubscription,
  getByStatus, clearHistory; capped at 500 records via AsyncStorage
- Export useTransactionStore from src/store/index.ts
- Add TransactionHistory route to RootStackParamList
…d explorer link

- Add src/screens/TransactionHistoryScreen.tsx:
  - FlatList of all transactions, newest first
  - Filter chips: All / Confirmed / Pending / Failed
  - Each row shows subscription name, date, type, amount, status badge
  - Crypto transactions show shortened tx hash
  - Tap a row to open a bottom-sheet detail panel with full info
  - Detail panel shows txHash, chainId, failureReason, notes
  - 'View on Block Explorer' button opens explorerUrl/tx/<hash> via
    Linking.openURL (satisfies 'links to explorer' acceptance criterion)
- Register TransactionHistory screen in AppNavigator (SettingsStack)
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Jun 1, 2026

@senmalong Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Smartdevs17
Copy link
Copy Markdown
Owner

⚠️ Merge failed — check CI status.

🤖 Drips Wave Merge Agent

@Smartdevs17
Copy link
Copy Markdown
Owner

❌ This PR has merge conflicts.

Hi @senmalong,

Please resolve the conflicts with main so this can be merged.


🤖 Drips Wave Merge Agent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

📊 Add transaction history tracking

2 participants